#!/bin/sh

FILE=""
if [ "$1" == "" ]; then
    echo "No input file provided"
    exit 3
else
    FILE="$1"
    #make sure fine exists and readable
    if [ ! -f $FILE ]; then
        echo "$FILE : does not exist"
        exit 1
    elif [ ! -r $FILE ]; then
        echo "$FILE : cannot read"
        exit 2
    fi
fi
exec 3<&0
exec 0<"$FILE"
while read -d "|" folder
do
    #make folder for repository
    echo "$folder"
    cd $folder
    svn update
    cd ..
    read -e folder
done
exec 0<&3

echo "All Done!"
exit 0
